import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    openSider: true,
    patientId: '',
    showTipNum: 0
  },
  mutations: {
    setOpenSider(state, newVal) {
      state.openSider = newVal
    },
    setPatientId(state, payload) {
      state.patientId = payload
    },
    setShowTip(state, payload) {
      state.showTipNum = payload
    }
  },
  getters: {
    getOpenSider(state) {
      return state.openSider
    },
    getShowTip(state) {
      return state.showTipNum
    }
  }
})

export default store